package com.yjs.ppjokedemo.ui.detail;

import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.TextView;

import androidx.appcompat.app.AppCompatActivity;

import com.alibaba.android.arouter.facade.annotation.Autowired;
import com.alibaba.android.arouter.facade.annotation.Route;
import com.alibaba.android.arouter.launcher.ARouter;
import com.bumptech.glide.Glide;
import com.yjs.ppjokedemo.R;

@Route(path = "/app/SofaTextDetailActivity")
public class SofaTextDetailActivity extends AppCompatActivity {

    @Autowired
    Bundle dataBean;
    private FrameLayout titleLayout;
    private ImageView actionClose;
    private TextView title;
    private ImageView ivSofaTextTou;
    private TextView tvTextAuthorName;
    private Button textDetailBt;
    private TextView tvTextCaption;
    private ImageView homeLogo;
    private TextView inputViewSofaPic;
    private ImageView ivLikePic;
    private ImageView ivLikeCollect;
    private ImageView ivLikeShare;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_sofa_text_detail);
        initView();
    }

    private void initView() {
        ARouter.getInstance().inject(this);
        titleLayout = (FrameLayout) findViewById(R.id.title_layout);
        actionClose = (ImageView) findViewById(R.id.action_close);
        title = (TextView) findViewById(R.id.title);
        ivSofaTextTou = (ImageView) findViewById(R.id.iv_sofa_textTou);
        tvTextAuthorName = (TextView) findViewById(R.id.tv_text_authorName);
        textDetailBt = (Button) findViewById(R.id.text_detail_bt);
        tvTextCaption = (TextView) findViewById(R.id.tv_text_caption);
        homeLogo = (ImageView) findViewById(R.id.home_logo);
        inputViewSofaPic = (TextView) findViewById(R.id.input_view_sofaPic);
        ivLikePic = (ImageView) findViewById(R.id.iv_like_pic);
        ivLikeCollect = (ImageView) findViewById(R.id.iv_like_collect);
        ivLikeShare = (ImageView) findViewById(R.id.iv_like_share);

        actionClose.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });

        Glide.with(this)
                .load(dataBean.getString("ivTou"))
                .circleCrop()
                .into(ivSofaTextTou);

        tvTextAuthorName.setText(dataBean.getString("name"));
        tvTextCaption.setText(dataBean.getString("caption"));

    }
}